﻿import 'package:get/get.dart';
import 'actionView.dart';
import 'create_plan/create_plan_view.dart';
import 'create_plan/create_plan_logic.dart';
import 'create_plan/questionnaire_plan_view.dart';
import 'course_list_page.dart';

// 导入所有子模块路由
import 'questionnaire/routes.dart';
import 'sleep_aid/routes.dart';
import 'stress_relief/routes.dart';

/// 行动模块路由配置
/// 聚合所有子模块路由
class ActionRoutes {
  /// 行动主页
  static const String action = '/action';
  
  /// 创建计划页
  static const String createPlan = '/action/create-plan';
  
  /// 由问卷生成计划页
  static const String questionnairePlan = '/action/questionnaire-plan';
  
  /// 课程列表页
  static const String courseList = '/course-list';

  static final List<GetPage> routes = [
    // 主页路由
    GetPage(
      name: action,
      page: () => const ActionView(),
    ),
    GetPage(
      name: createPlan,
      page: () => const CreatePlanView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => CreatePlanLogic());
      }),
    ),
    GetPage(
      name: questionnairePlan,
      page: () => const QuestionnairePlanView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => CreatePlanLogic());
      }),
    ),
    GetPage(
      name: courseList,
      page: () => const CourseListPage(),
    ),
    
    // 聚合所有子模块路由
    ...QuestionnaireRoutes.routes,
    ...SleepAidRoutes.routes,
    ...StressReliefRoutes.routes,
  ];
}
